package com.hx.springboot.dome01.controller;

import com.github.pagehelper.PageHelper;
import com.hx.springboot.dome01.mapper.BookInfoMapper;
import com.hx.springboot.dome01.pojo.BookInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    BookInfoMapper bookInfoMapper;
    @GetMapping("/test")
    public String test() {
        System.out.println("UserController  test...");
        return "test";
    }
    @GetMapping("/findAll")
    public List<BookInfo> findAll() {
        PageHelper.startPage(1,5 );
        List<BookInfo>list=bookInfoMapper.findAll();
        return list;
    }

}
